package cn.ingrun.first_spring_cloud_client.controller;


import cn.ingrun.first_spring_cloud_client.models.User;
import cn.ingrun.first_spring_cloud_client.models.ResponseJson;
import cn.ingrun.first_spring_cloud_client.utils.MyResponse;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class Hello {

    @GetMapping("/")
    public String hello(){
        return "Hello world";
    }

    @GetMapping( value = "/getUser")
    public MyResponse get(@RequestParam("id") int id){
//        return MyResponse.success(1, "200", new User(id, "Jark", "123456"), HttpStatus.OK );
        return MyResponse.error( "用户登陆失效" ,HttpStatus.UNAUTHORIZED);
    }


}
